let QueryPostHandle = function () {
}

QueryPostHandle.prototype.listenSubmitEvent = function () {
     let self = this;
    $("#query").click(function (event) {
        let post_kw = $("#post-kw").val();
        if (!post_kw) {
            event.preventDefault();
            event.stopPropagation();
            xtalert.alertInfoToast("请输入关键字");
            return false;
        }

         // 在新窗口/标签页中打开搜索页面
        window.open("/post/query/?kw=" + encodeURIComponent(post_kw), "_blank");
    });
}

QueryPostHandle.prototype.run = function (){
    this.listenSubmitEvent();
}


$(function () {
    let queryPostHandle = new QueryPostHandle();
    queryPostHandle.run();
})
